<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>10_过渡&动画2</title>
  <style>
    .v-enter-active {
      animation: move 3s linear alternate-reverse;
    }

    .v-leave-active {
      animation: move 3s linear;
    }

    @keyframes move {
      0% {
        transform: translateX(0px);
      }

      50% {
        transform: translateX(200px);
      }

      100% {
        transform: translateX(100px);
      }
    }
  </style>
</head>

<body>

  <div id="app">
    <button @click="isShow = !isShow">按钮</button>
    <transition>
      <p v-show="isShow">陶哥真帅</p>
    </transition>
  </div>

  <script type="text/javascript" src="../js/vue.js"></script>

  <script>
    /*
      transition
        vue内置组件
        作用：用来给包裹显示&隐藏元素添加过渡或动画效果（添加类名）
        辅助样式才能生效
    */
    new Vue({
      el: '#app',
      data: {
        isShow: true
      }
    })
  </script>
</body>

</html>